package com.zgjkhis.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * @Author yzq
 * @Description 供应商
 * @Date 2021/6/23 9:38
 * @Param
 * @return
 **/
@Data
@TableName("his_consult")
public class Consult implements Serializable {

    @TableId
    private Long id;
    @ApiModelProperty(value = "问诊号")
    private String consultNo;
    @ApiModelProperty(value = "接诊类型1：初诊，2：复诊，3：急诊,4:体验")
    @NotNull(message = "接诊类型不能为空")
    @Range(min=1,max=4,message = "接诊类型")
    private Integer consultType;
    @ApiModelProperty(value = "就诊科室")
    private String consultDepartName;
    @ApiModelProperty(value = "就诊科室id")
    @NotNull(message = "就诊科室id不能为空")
    private String consultDepartId;
    @ApiModelProperty(value = "就诊医生")
    private String consultDocName;
    @ApiModelProperty(value = "就诊医生id")
    @NotNull(message = "就诊医生id不能为空")
    private String consultDocId;
    @ApiModelProperty(value = "患者id")
    private String patientId;
    @ApiModelProperty(value = "患者姓名")
    private String patientName;

    @ApiModelProperty(value = "发病日期")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    private Date morbidityDate;
    @ApiModelProperty(value = "主诉")
    private String consultComplaint;
    @ApiModelProperty(value = "现病史")
    private String consultHpi;
    @ApiModelProperty(value = "过敏史")
    private String allergicHistory;
    @ApiModelProperty(value = "是否食源疾病 0：否，1：是")
    private Integer isFood;
    @ApiModelProperty(value = "慢性病 0：否，1：是")
    private Integer isChronicDisease;
    @ApiModelProperty(value = "危重标志0：否，1：是")
    private Integer criticalSigns;
    @ApiModelProperty(value = "个人史")
    private String personalHistory;
    @ApiModelProperty(value = "家族史")
    private String familyHistory;
    @ApiModelProperty(value = "既往史")
    private String pastHistory;
    @ApiModelProperty(value = "诊断")
    private String diagnosis;
    @ApiModelProperty(value = "医嘱")
    private String docAdvice;
    @ApiModelProperty(value = "病例")
    private String caseUrl;
    @ApiModelProperty(value = "体温")
    private String temperature;
    @ApiModelProperty(value = "体重")
    private String weight;
    @ApiModelProperty(value = "心率")
    private String heartRate;
    @ApiModelProperty(value = "血压-高")
    private String bloodPressureHigh;
    @ApiModelProperty(value = "血压-低")
    private String bloodPressureLow;
    @ApiModelProperty(value = "血糖")
    private String bloodSugar;


    @ApiModelProperty(value = "备注")
    private String remark;
    /** 创建时间 */
    @TableField(fill= FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "药房id",required = true)
    private String pharmacyId;

    @ApiModelProperty(value = "1:待就诊，2：就诊中，3：已完成，4：已取消",required = true)
    private Integer consultStatus;

    @ApiModelProperty(value = "1:直接挂号，2：预约挂号，3：第三方同步预约")
    @NotNull(message = "挂号类型不能为空")
    @Range(min=1,max=2,message = "挂号类型错误")
    private Integer consultFlag;
    @ApiModelProperty(value = "操作人id")
    private String createUserId;
    @ApiModelProperty(value = "操作人姓名")
    private String createUserName;
    @ApiModelProperty(value = "修改人id")
    private String updateUserId;
    @ApiModelProperty(value = "修改人姓名")
    private String updateUserName;


    public void copy(Consult source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
